package com.elai.tags.service.impl;

import java.util.List;
import com.elai.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.elai.tags.mapper.BaseUserPortraitCompentsMapper;
import com.elai.tags.domain.BaseUserPortraitCompents;
import com.elai.tags.service.IBaseUserPortraitCompentsService;

/**
 * 画像组件Service业务层处理
 * 
 * @author elai
 * @date 2022-03-14
 */
@Service
public class BaseUserPortraitCompentsServiceImpl implements IBaseUserPortraitCompentsService 
{
    @Autowired
    private BaseUserPortraitCompentsMapper baseUserPortraitCompentsMapper;

    /**
     * 查询画像组件
     * 
     * @param portraitId 画像组件ID
     * @return 画像组件
     */
    @Override
    public BaseUserPortraitCompents selectBaseUserPortraitCompentsById(Long portraitId)
    {
        return baseUserPortraitCompentsMapper.selectBaseUserPortraitCompentsById(portraitId);
    }

    /**
     * 查询画像组件列表
     * 
     * @param baseUserPortraitCompents 画像组件
     * @return 画像组件
     */
    @Override
    public List<BaseUserPortraitCompents> selectBaseUserPortraitCompentsList(BaseUserPortraitCompents baseUserPortraitCompents)
    {
        return baseUserPortraitCompentsMapper.selectBaseUserPortraitCompentsList(baseUserPortraitCompents);
    }

    /**
     * 新增画像组件
     * 
     * @param baseUserPortraitCompents 画像组件
     * @return 结果
     */
    @Override
    public int insertBaseUserPortraitCompents(BaseUserPortraitCompents baseUserPortraitCompents)
    {
        baseUserPortraitCompents.setCreateTime(DateUtils.getNowDate());
        return baseUserPortraitCompentsMapper.insertBaseUserPortraitCompents(baseUserPortraitCompents);
    }

    /**
     * 修改画像组件
     * 
     * @param baseUserPortraitCompents 画像组件
     * @return 结果
     */
    @Override
    public int updateBaseUserPortraitCompents(BaseUserPortraitCompents baseUserPortraitCompents)
    {
        return baseUserPortraitCompentsMapper.updateBaseUserPortraitCompents(baseUserPortraitCompents);
    }

    /**
     * 批量删除画像组件
     * 
     * @param portraitIds 需要删除的画像组件ID
     * @return 结果
     */
    @Override
    public int deleteBaseUserPortraitCompentsByIds(Long[] portraitIds)
    {
        return baseUserPortraitCompentsMapper.deleteBaseUserPortraitCompentsByIds(portraitIds);
    }

    /**
     * 删除画像组件信息
     * 
     * @param portraitId 画像组件ID
     * @return 结果
     */
    @Override
    public int deleteBaseUserPortraitCompentsById(Long portraitId)
    {
        return baseUserPortraitCompentsMapper.deleteBaseUserPortraitCompentsById(portraitId);
    }
}
